package com.gugee.tiktok.web.dto;

import com.gugee.tiktok.web.model.mysql.HelpMenu;
import lombok.Data;
import org.mapstruct.Mapper;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * 菜单
 */
@Data
public class HelpCenterMenuDto implements Serializable {
    //菜单id
    private Long id;
    //父菜单id  一级菜单该值为空
    private Long parentId;
    //菜单名称
    private String name;
     //字体图标
    private String icons;

    //文章列表地址或文章地址
    private String url;
    //菜单排序号
    private String menuSort;
    //子菜单列表
    private List<HelpCenterMenuDto> subMenus=new ArrayList<>();

    public void  putSubMenu(HelpCenterMenuDto sub){
        subMenus.add(sub);
    }

    @Mapper(componentModel = "spring")
    public interface HelpCenterMenuDtoMapper {

        HelpCenterMenuDto mapperDto(HelpMenu dto);
        List<HelpCenterMenuDto> mapperList(List<HelpMenu> dtos);

    }
}
